package com.ruoyi.web.controller.laiqianba.source;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.db.domain.SourcePushResultInfo;
import com.ruoyi.source.service.ISourceBaseInfoService;
import com.ruoyi.source.service.ISourcePushResultInfoService;
import com.ruoyi.web.wrapper.SourcePushResultInfoWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 线索账单表
 */
@RestController
@RequestMapping("/source/account")
public class SourceAccountInfoController extends BaseController
{

    @Autowired
    private ISourcePushResultInfoService sourcePushResultInfoService;

    /**
     * 查询线索基本信息列表
     */
    @PreAuthorize("@ss.hasPermi('source:account:list')")
    @GetMapping("/list")
    public TableDataInfo list(SourcePushResultInfo sourcePushResultInfo)
    {
        startPage();
        List<Map<String, Object>> list = sourcePushResultInfoService.selectAccountMapList(sourcePushResultInfo);
        return getDataTable(list);
    }

    /**
     * 查询线索推送结果列表
     */
    @PreAuthorize("@ss.hasPermi('source:account:list')")
    @GetMapping("/list1")
    public TableDataInfo list1(SourcePushResultInfo sourcePushResultInfo)
    {
        startPage();
        List<Map<String, Object>> list = sourcePushResultInfoService.selectSourcePushResultInfoMapList1(sourcePushResultInfo);
        list = new SourcePushResultInfoWrapper(list).wrap();
        return getDataTable(list);
    }

}
